﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace StudentLX
{
    public partial class AddForm : Form
    {
        public AddForm()
        {
            InitializeComponent();
        }


        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            var name = AddName.Text;
            var age = AddAge.Text;
            var score = AddScore.Text;

            var sql = string.Format("insert into Students (Name,Age,Score) values ('{0}','{1}','{2}')", name, age, score);
            var dt = Dbhelp.Addupdate(sql);
            MessageBox.Show("添加成功");
            this.Close();
        }
    }
}
